<?php if(count($posts) > 0): ?>
    <?php $url = Yii::app()->controller->id . "/" . Yii::app()->controller->action->id; ?>
<h2 class="border-bot">Related <span>Posts</span></h2>
    <?php foreach($posts as $post): ?>
        <div class="wrapper border-bot1 title2">
            <div class="col-padding">
                <div class="wrapper">
                    <div class="img-indent"><img src="images/2page_img8.png" alt=""></div>
                    <div class="extra-wrap">
                        <h5><?php echo $post->title; ?></h5>
                        <?php echo substr($post->content, 0, 100); ?>... <a class="link-1" href="<?php echo Yii::app()->createAbsoluteUrl($url, array('post_id' => $post->id)); ?>">More</a>
                    </div>
                </div>
            </div>
        </div>
    <?php endforeach; ?>
<?php endif; ?>